/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.behavioral.iterator;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author jmg
 */
public class MyArraryList2<T> {
    
    private List<T> data = new ArrayList<T>();
            
    public T get(int  index){
        return  data.get(index);
    }
    public void add(T t ){
        data.add(t);
    }
    
    public int size(){
        return  data.size();
    }
    
    public void remove(int index){
        data.remove(index);
    }
    
    public Iterator<T> iterator(){
       return new MyArraryListIterator1<T>(this);
    }
    
}
